<html>
<body>
<p>There can be errors.</p>

<script>
function myFunction()
{
	try
	{
		allert("Welcome!");
	}
	catch(e)
	{
		alert(e.message);
	}
}
</script>
<button onclick="myFunction()" >check error</button>
</body>

</html>